Developer --> Technical Publications
PATHMac OS 8 Developer Documentation > Files > Navigation Services >

Programming With Navigation Services 1.1


Event Message Constants

Your application can provide an event-handling function to update application windows and handle other events related to your Open and Save dialog boxes. Navigation Services informs you of pertinent events by supplying event message constants to your event-handling function via the param field of the structure of type NavCBRec . These constants are defined in the NavEventCallbackMessages data type. For more information, see Handling Events.

enum {
    kNavCBEvent             = 0,    /*  event has occurred */
kNavCBCustomize         = 1,    /*  signal to negotiate
                                        customization space */
kNavCBStart             = 2,    /*  nav dialog box starting up */
kNavCBTerminate         = 3,    /*  nav dialog box closing down */
kNavCBAdjustRect        = 4,    /*  nav dialog box being resized */
kNavCBNewLocation       = 5,    /*  user chose new location*/
kNavCBShowDesktop       = 6,    /*  user navigated to the desktop */
kNavCBSelectEntry       = 7,    /*  user made selection in browser */
kNavCBPopupMenuSelect   = 8,    /*  user made popup menu selection */
kNavCBAccept            = 9,    /*  user accepted nav dialog box */
kNavCBCancel            = 10,   /*  user cancelled nav dialog box */
kNavCBAdjustPreview     = 11    /*  preview toggled or resized */
}
typedef UInt32 NavEventCallbackMessages;

Constant descriptions

kNavCBEvent
Tells your application that an event has occurred (including an idle event), which provides an opportunity for your application to track controls, update other windows, and so forth. Your application can obtain the event record describing this event from the event field of the structure of type NavCBRec . The kNavCBEvent constant is the only message that needs to be processed by most applications that do not customize Open and Save dialog boxes.
kNavCBCustomize
Tells your application to supply a dialog box customization request. The customRect field of the NavCBRec structure defines a rectangle in the local coordinates of the dialog box; the top-left coordinates define the anchor point for a customization rectangle. If you want to customize the dialog box, your application responds to the kNavCBCustomize message by setting a value in the customRect field that completes the dimensions of the customization rectangle. After your application responds, Navigation Services inspects the customRect field to determine if the requested dimensions result in a dialog box that can fit on the screen. If the dimensions are too large, then Navigation Services responds by setting the rectangle to the largest size that the screen can accommodate. Your application can continue to "negotiate" by examining the customRect field and requesting a different size until Navigation Services provides an acceptable rectangle value, at which time you should create your custom control or item list. The minimum size for the customization area is 400 pixels wide by 40 pixels high. For more information, see Adding Custom Controls.

NOTE

Don't add new dialog box items until your application receives the kNavCBStart event message constant.

kNavCBStart
Tells your application that a dialog box is ready to be displayed. After receiving the kNavCBCustomize event message constant, your event-handling function should wait for the kNavCBStart event message constant to ensure that your application can safely add dialog items. No additional data is provided to your application with this constant. For more information, see Adding Custom Controls.
kNavCBTerminate
Tells your application that the dialog box is about to be closed, which means you must remove any user-interface items that were created in response to the kNavCBStart message. No additional data is provided to your application with this constant.
kNavCBAdjustRect
Tells your application that the dialog box has been resized and the customization rectangle has been accordingly resized. Use the customRect field from the structure of type NavCBRec to determine the new customization rectangle size. Your application does not need to offset the controls; Navigation Services moves them automatically. Your application is responsible for any redrawing of the controls or handling events beyond moving the controls, however. For more information, see Adding Custom Controls.
kNavCBNewLocation
Tells your application that a new location is being viewed in the dialog box. The param field of the NavCBRec structure contains a pointer to an AEDesc structure of type 'typeFSS' describing the new location. This pointer is valid only during the execution of your event-handling function. For more information on how to parse AEDesc structures, see Obtaining Object Descriptions.
kNavCBShowDesktop
Tells your application that the Open or Save dialog box is showing the desktop view, consisting of the composite of all desktop folders from all mounted volumes. The param field of the NavCBRec structure contains a pointer to an AEDescList structure identifying the desktop location. This pointer is valid only during the execution of your event-handling function. For more information on how to parse AEDesc structures, see Obtaining Object Descriptions.
kNavCBSelectEntry
Tells your application that an entry in the browser list has been selected or deselected by the user. The param field of the NavCBRec structure contains a pointer to an AEDescList record of type 'typeFSS' identifying the current selection. If the user deselects the current selection, the AEDescList record contains an empty reference. This pointer is valid only during the execution of your event-handling function. For more information on how to parse AEDesc structures, see Obtaining Object Descriptions.
kNavCBPopupMenuSelect
Tells your application that a selection was made from the Open dialog box's Show pop-up menu or Save dialog box's Format pop-up menu. The param field of the NavCBRec structure contains a pointer to a structure of type NavMenuItemSpec describing the pop-up menu item selected. This data is valid only during the execution of your event-handling function.
kNavCBAccept
Tells your application that the user has pressed the Accept button.
kNavCBCancel
Tells your application that the user has pressed the Cancel button.
kNavCBAdjustPreview
Tells your application that the user has toggled the preview area on or off. The param field of the NavCBRec structure contains a pointer to a Boolean value of true if the preview area is toggled on and false if toggled off. This information is useful if your application creates custom controls in the preview area. For more information, see Drawing Custom Previews.

© 1998 Apple Computer, Inc. – (Last Updated 23 Nov 98)

Previous | Back Up One Level | Next |